import Vue from 'vue'
import Vuex from 'vuex'
import user from './user'
import address from './address'
import persistence from 'vuex-uniapp-persistence'

Vue.use(Vuex)
const store = new Vuex.Store({
  plugins: [persistence()], //vuex数据持久化
  state: {
    safeArea: uni.getWindowInfo().safeArea,
    capsule: uni.getMenuButtonBoundingClientRect(),
    platform: uni.getSystemInfoSync().platform
  },
  modules: {
    user,
    address
  }
})
export default store
